{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第一节 平均发展速度"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 实验7-1 基于几何法的平均发展速度"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1996-2002年AWAGE如下，试用几何平均法计算这期间的平均发展速度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>AWAGE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1996</td>\n",
       "      <td>6210</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1997</td>\n",
       "      <td>6470</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1998</td>\n",
       "      <td>7479</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1999</td>\n",
       "      <td>8346</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2000</td>\n",
       "      <td>9371</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2001</td>\n",
       "      <td>10870</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2002</td>\n",
       "      <td>12422</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Year  AWAGE\n",
       "0  1996   6210\n",
       "1  1997   6470\n",
       "2  1998   7479\n",
       "3  1999   8346\n",
       "4  2000   9371\n",
       "5  2001  10870\n",
       "6  2002  12422"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "awage_df = pd.read_excel('7-1.xlsx')\n",
    "awage_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.1041149108057335"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Xg = np.power(awage_df.loc[6,'AWAGE'] / awage_df.loc[0,'AWAGE'] , 1/(len(awage_df - 1)))\n",
    "Xg"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "结论 平均发展速度为112.25%"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 实验7-2 基于方程式法的平均发展速度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "from scipy.optimize import fsolve , minimize"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1.11220723])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# fsolve方法\n",
    "y = awage_df.loc[1:,'AWAGE'].sum() / awage_df.loc[0,'AWAGE']\n",
    "\n",
    "result = fsolve(lambda x: x[0] + x[0]**2 + x[0]**3 + x[0]**4 + x[0]**5 + x[0]**6 - y , (1.05,))\n",
    "\n",
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1.11220723])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# minimize方法\n",
    "cons = ({'type':'eq','fun':lambda x: x[0] + x[0]**2 + x[0]**3 + x[0]**4 + x[0]**5 + x[0]**6 - y})\n",
    "fun = lambda x:x[0]\n",
    "result = minimize(fun , (1.05,),method='SLSQP', constraints=cons)\n",
    "\n",
    "result.x"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第二节 长期趋势的测定"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 实验7-3 移动平均测定长期趋势"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "根据过去12个月的销量，用移动平均法对其下一时期进行预测。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Month</th>\n",
       "      <th>Q</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>435149</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>372658</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>370422</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>378568</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>351045</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>388963</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>405176</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>357536</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>439776</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>344008</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>370086</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>357517</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Month       Q\n",
       "0       1  435149\n",
       "1       2  372658\n",
       "2       3  370422\n",
       "3       4  378568\n",
       "4       5  351045\n",
       "5       6  388963\n",
       "6       7  405176\n",
       "7       8  357536\n",
       "8       9  439776\n",
       "9      10  344008\n",
       "10     11  370086\n",
       "11     12  357517"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sell_df = pd.read_excel('7-3.xlsx')\n",
    "sell_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Month</th>\n",
       "      <th>Q</th>\n",
       "      <th>AVG3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>435149</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>372658</td>\n",
       "      <td>392743.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>370422</td>\n",
       "      <td>373882.666667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>378568</td>\n",
       "      <td>366678.333333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>351045</td>\n",
       "      <td>372858.666667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>388963</td>\n",
       "      <td>381728.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>405176</td>\n",
       "      <td>383891.666667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>357536</td>\n",
       "      <td>400829.333333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>439776</td>\n",
       "      <td>380440.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>344008</td>\n",
       "      <td>384623.333333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>370086</td>\n",
       "      <td>357203.666667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>357517</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Month       Q           AVG3\n",
       "0       1  435149            NaN\n",
       "1       2  372658  392743.000000\n",
       "2       3  370422  373882.666667\n",
       "3       4  378568  366678.333333\n",
       "4       5  351045  372858.666667\n",
       "5       6  388963  381728.000000\n",
       "6       7  405176  383891.666667\n",
       "7       8  357536  400829.333333\n",
       "8       9  439776  380440.000000\n",
       "9      10  344008  384623.333333\n",
       "10     11  370086  357203.666667\n",
       "11     12  357517            NaN"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 利用pandas中rolling方法计算移动平均值，当平均的项数是奇数时\n",
    "sell_df.loc[:,'AVG3'] = sell_df.loc[:,'Q'].rolling(window=3,center=True).mean()\n",
    "sell_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Month</th>\n",
       "      <th>Q</th>\n",
       "      <th>AVG3</th>\n",
       "      <th>AVG4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>435149</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>372658</td>\n",
       "      <td>392743.000000</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>370422</td>\n",
       "      <td>373882.666667</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>378568</td>\n",
       "      <td>366678.333333</td>\n",
       "      <td>378686.250</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>351045</td>\n",
       "      <td>372858.666667</td>\n",
       "      <td>370211.375</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>388963</td>\n",
       "      <td>381728.000000</td>\n",
       "      <td>376593.750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>405176</td>\n",
       "      <td>383891.666667</td>\n",
       "      <td>378309.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>357536</td>\n",
       "      <td>400829.333333</td>\n",
       "      <td>386771.375</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>439776</td>\n",
       "      <td>380440.000000</td>\n",
       "      <td>392243.375</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>344008</td>\n",
       "      <td>384623.333333</td>\n",
       "      <td>382237.750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>370086</td>\n",
       "      <td>357203.666667</td>\n",
       "      <td>377849.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>357517</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Month       Q           AVG3        AVG4\n",
       "0       1  435149            NaN         NaN\n",
       "1       2  372658  392743.000000         NaN\n",
       "2       3  370422  373882.666667         NaN\n",
       "3       4  378568  366678.333333  378686.250\n",
       "4       5  351045  372858.666667  370211.375\n",
       "5       6  388963  381728.000000  376593.750\n",
       "6       7  405176  383891.666667  378309.000\n",
       "7       8  357536  400829.333333  386771.375\n",
       "8       9  439776  380440.000000  392243.375\n",
       "9      10  344008  384623.333333  382237.750\n",
       "10     11  370086  357203.666667  377849.125\n",
       "11     12  357517            NaN         NaN"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 当平均的项数是偶数时，需要用两次\n",
    "sell_df.loc[:,'AVG4'] = sell_df.loc[:,'Q'].rolling(window=4,center=True).mean().rolling(window=2,center=True).mean()\n",
    "sell_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 实验7-4 趋势模型法测定长期趋势"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1989-2003年出口总额，试测定其长期趋势（要求用二次曲线方程测定长期趋势）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1989</td>\n",
       "      <td>525.38</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1990</td>\n",
       "      <td>620.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1991</td>\n",
       "      <td>719.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1992</td>\n",
       "      <td>849.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1993</td>\n",
       "      <td>917.44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1994</td>\n",
       "      <td>1210.06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1995</td>\n",
       "      <td>1487.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1996</td>\n",
       "      <td>1510.48</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1997</td>\n",
       "      <td>1827.92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1998</td>\n",
       "      <td>1837.09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1999</td>\n",
       "      <td>1949.31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2000</td>\n",
       "      <td>2492.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2001</td>\n",
       "      <td>2660.98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2002</td>\n",
       "      <td>3255.96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2003</td>\n",
       "      <td>4382.28</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year   Amount\n",
       "0   1989   525.38\n",
       "1   1990   620.91\n",
       "2   1991   719.10\n",
       "3   1992   849.40\n",
       "4   1993   917.44\n",
       "5   1994  1210.06\n",
       "6   1995  1487.80\n",
       "7   1996  1510.48\n",
       "8   1997  1827.92\n",
       "9   1998  1837.09\n",
       "10  1999  1949.31\n",
       "11  2000  2492.03\n",
       "12  2001  2660.98\n",
       "13  2002  3255.96\n",
       "14  2003  4382.28"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "export_df = pd.read_excel('7-4 .xlsx')\n",
    "export_df "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "plt.rcParams['font.sans-serif'] = ['SimHei'] # 步骤一（替换sans-serif字体）\n",
    "plt.rcParams['axes.unicode_minus'] = False   # 步骤二（解决坐标轴负数的负号显示问题）\n",
    "plt.rcParams['savefig.dpi'] = 100 # 图片质量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x22cd0206588>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAECCAYAAAD0JMwBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm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hc7YWCLOeKMvsWtxNhOvxRniWAp8AvxcnJ2s+48eollieho3UVVLPSnuIZBrvDoXaUc9n8rnSdwEt1fs73zD6XMQKu/B4zjf1YU4M5D24uxruVREluNstbXHGfLwprB5EredG9ebnrsncTsAXVR1lZ/jpuL9+9CgcCvwW1X1QQAReRF4QFXvFGcGyXScnREXq6q3xf3w2C8B96tq3U7UGJzNfm9nNgQipqdxvZ0/G8xcfeFJXF/mfbe0z0FQ3wN3R2JbnB+HPqo6192JPBznwK4qnK3wK3CGZdYFKK5HwxwhFNej96ExYTEGLyI/d+92FpFnxTkyLw/nDUNVJ+L05oepaq4fYi+ri+3G3wrcXdfLDEZMyzX84oZTroGI6w5HvIQzIaEnkCYiPVV1HU6hq8aZGvgUME6dGVqNDnVYXM+FRYEHbhDnQIVJOGOWk3A2X4aJyFgAVd3s45jV0WKPEJFT6j1vX5BjWq7hFzeccg1E3Cdwdp7egXOE6onAeSLS290hmYgzKwucoQpPWVwPhfQQjbtZk4xz4MognGl0t9ZbnoSHc7t9jH3wyEdVbXSTNBAxLdfwixtOuQYyLs7smHxV3SwirwCX4UxVnCTOqT4qgPe8jGlxvRDSPXh1FOPspb4GZ7riC/Wesp0fjygLeuxA5dvacw23uOGUayDj4swNX+He34sz3/+PONMhd+BM5/RmqrHF9VJYXLJPnHNd1J2j4ymgs6peHaqxA5Vva8813OKGU66BjOvGi8SZBvktcDNwlTpHMVtcP8Q9KvXxCKnmvuH+GLn3H8f58IVs7EDl29pzDbe44ZRrIN8DnB21u3GOIfHqiE+L6/stLHrwdcQ5CMZvJ9gPdOxA5dvacw23uOGUa6DiuuP8vwVeVS+P+LS4Tfh74VTgjTHhq/4QkMX1f9wG/5YVeGOMaZlCehaNMcYY31mBN8aYFsoKvDHGtFBW4I0xpoWyAm+MMS3U/weEMqShOSu3YQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = export_df['Year']\n",
    "y = export_df['Amount']\n",
    "plt.plot(x,y,'-',label='出口总额')\n",
    "plt.xticks(x,rotation = 45)\n",
    "plt.legend(loc='lower right')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1.68191653e+01, -6.69143283e+04,  6.65546113e+07])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 利用numpy拟合二次曲线\n",
    "params = np.polyfit(x , y , deg=2)\n",
    "params"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 665.46626473,  674.59679413,  717.36565417,  793.77284485,\n",
       "        903.81836617, 1047.50221813, 1224.82440074, 1435.78491398,\n",
       "       1680.38375787, 1958.6209324 , 2270.49643757, 2616.0102734 ,\n",
       "       2995.16243985, 3407.95293695, 3854.3817647 ])"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 利用numpy求出口总额的估计值，并计算R方\n",
    "\n",
    "_y = np.polyval(params , x)\n",
    "_y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9575667909239387"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r2 = np.sum((_y - np.mean(y))**2) / np.sum((y-np.mean(y))**2)\n",
    "r2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x22cd14768c8>"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAECCAYAAAD0JMwBA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
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 画出拟合曲线\n",
    "plt.plot(x,y,'-',label='出口总额')\n",
    "plt.plot(x,_y,label='拟合曲线')\n",
    "plt.xticks(x,rotation = 45)\n",
    "plt.legend(loc='lower right')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 上述二次曲线的拟合方程也可以用回归方法求得\n",
    "import statsmodels.formula.api as smf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Amount</th>\n",
       "      <th>YearSquare</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1989</td>\n",
       "      <td>525.38</td>\n",
       "      <td>3956121</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1990</td>\n",
       "      <td>620.91</td>\n",
       "      <td>3960100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1991</td>\n",
       "      <td>719.10</td>\n",
       "      <td>3964081</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1992</td>\n",
       "      <td>849.40</td>\n",
       "      <td>3968064</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1993</td>\n",
       "      <td>917.44</td>\n",
       "      <td>3972049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1994</td>\n",
       "      <td>1210.06</td>\n",
       "      <td>3976036</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1995</td>\n",
       "      <td>1487.80</td>\n",
       "      <td>3980025</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1996</td>\n",
       "      <td>1510.48</td>\n",
       "      <td>3984016</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1997</td>\n",
       "      <td>1827.92</td>\n",
       "      <td>3988009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1998</td>\n",
       "      <td>1837.09</td>\n",
       "      <td>3992004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1999</td>\n",
       "      <td>1949.31</td>\n",
       "      <td>3996001</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2000</td>\n",
       "      <td>2492.03</td>\n",
       "      <td>4000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2001</td>\n",
       "      <td>2660.98</td>\n",
       "      <td>4004001</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2002</td>\n",
       "      <td>3255.96</td>\n",
       "      <td>4008004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2003</td>\n",
       "      <td>4382.28</td>\n",
       "      <td>4012009</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year   Amount  YearSquare\n",
       "0   1989   525.38     3956121\n",
       "1   1990   620.91     3960100\n",
       "2   1991   719.10     3964081\n",
       "3   1992   849.40     3968064\n",
       "4   1993   917.44     3972049\n",
       "5   1994  1210.06     3976036\n",
       "6   1995  1487.80     3980025\n",
       "7   1996  1510.48     3984016\n",
       "8   1997  1827.92     3988009\n",
       "9   1998  1837.09     3992004\n",
       "10  1999  1949.31     3996001\n",
       "11  2000  2492.03     4000000\n",
       "12  2001  2660.98     4004001\n",
       "13  2002  3255.96     4008004\n",
       "14  2003  4382.28     4012009"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "export_df.loc[:,'YearSquare'] = export_df.loc[:,'Year']**2\n",
    "export_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Intercept     6.655461e+07\n",
       "YearSquare    1.681917e+01\n",
       "Year         -6.691433e+04\n",
       "dtype: float64"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "export_model = smf.ols(formula='Amount ~ YearSquare + Year' , data=export_df)\n",
    "export_result = export_model.fit()\n",
    "export_result.params"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9575667909383319"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "export_result.rsquared"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第三节 季节变动与循环变动的测定"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 实验7-5 季节变动的测定"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "某公司近五年各季度销售额如下。用移动平均趋势剔除法计算各季度的季节指数。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Season</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>108</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>130</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>108</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>126</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>48</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>139</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>179</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>152</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>192</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year  Season    Y\n",
       "0      1       1   29\n",
       "1      1       2   90\n",
       "2      1       3  108\n",
       "3      1       4   14\n",
       "4      2       1   35\n",
       "5      2       2  112\n",
       "6      2       3  130\n",
       "7      2       4   24\n",
       "8      3       1   40\n",
       "9      3       2  108\n",
       "10     3       3  126\n",
       "11     3       4   28\n",
       "12     4       1   48\n",
       "13     4       2  139\n",
       "14     4       3  179\n",
       "15     4       4   33\n",
       "16     5       1   56\n",
       "17     5       2  152\n",
       "18     5       3  192\n",
       "19     5       4   35"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "season_df = pd.read_excel('7-5.xlsx')\n",
    "season_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:2: FutureWarning: Currently, 'apply' passes the values as ndarrays to the applied function. In the future, this will change to passing it as Series objects. You need to specify 'raw=True' to keep the current behaviour, and you can pass 'raw=False' to silence this warning\n",
      "  \n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Season</th>\n",
       "      <th>Y</th>\n",
       "      <th>M</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>29</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>90</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>108</td>\n",
       "      <td>61.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>14</td>\n",
       "      <td>64.500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>35</td>\n",
       "      <td>70.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>112</td>\n",
       "      <td>74.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>130</td>\n",
       "      <td>75.875</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>24</td>\n",
       "      <td>76.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>40</td>\n",
       "      <td>75.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>108</td>\n",
       "      <td>75.000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>126</td>\n",
       "      <td>76.500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>28</td>\n",
       "      <td>81.375</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>48</td>\n",
       "      <td>91.875</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>139</td>\n",
       "      <td>99.125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>179</td>\n",
       "      <td>100.750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>33</td>\n",
       "      <td>103.375</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>56</td>\n",
       "      <td>106.625</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>152</td>\n",
       "      <td>108.500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>192</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>35</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year  Season    Y        M\n",
       "0      1       1   29      NaN\n",
       "1      1       2   90      NaN\n",
       "2      1       3  108   61.000\n",
       "3      1       4   14   64.500\n",
       "4      2       1   35   70.000\n",
       "5      2       2  112   74.000\n",
       "6      2       3  130   75.875\n",
       "7      2       4   24   76.000\n",
       "8      3       1   40   75.000\n",
       "9      3       2  108   75.000\n",
       "10     3       3  126   76.500\n",
       "11     3       4   28   81.375\n",
       "12     4       1   48   91.875\n",
       "13     4       2  139   99.125\n",
       "14     4       3  179  100.750\n",
       "15     4       4   33  103.375\n",
       "16     5       1   56  106.625\n",
       "17     5       2  152  108.500\n",
       "18     5       3  192      NaN\n",
       "19     5       4   35      NaN"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 计算中心化四季移动平均值M\n",
    "mean_fun = lambda x:(0.5 * x[0] + x[1] + x[2] + x[3] + 0.5*x[4] ) / 4\n",
    "season_df.loc[:,'M'] = season_df.loc[:,'Y'].rolling(window=5,center=True).apply(mean_fun)\n",
    "season_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Season</th>\n",
       "      <th>Y</th>\n",
       "      <th>M</th>\n",
       "      <th>Y/M</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>90</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>108</td>\n",
       "      <td>61.000</td>\n",
       "      <td>1.770492</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>14</td>\n",
       "      <td>64.500</td>\n",
       "      <td>0.217054</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>35</td>\n",
       "      <td>70.000</td>\n",
       "      <td>0.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>112</td>\n",
       "      <td>74.000</td>\n",
       "      <td>1.513514</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>130</td>\n",
       "      <td>75.875</td>\n",
       "      <td>1.713344</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>24</td>\n",
       "      <td>76.000</td>\n",
       "      <td>0.315789</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>40</td>\n",
       "      <td>75.000</td>\n",
       "      <td>0.533333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>108</td>\n",
       "      <td>75.000</td>\n",
       "      <td>1.440000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>126</td>\n",
       "      <td>76.500</td>\n",
       "      <td>1.647059</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>28</td>\n",
       "      <td>81.375</td>\n",
       "      <td>0.344086</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>48</td>\n",
       "      <td>91.875</td>\n",
       "      <td>0.522449</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>139</td>\n",
       "      <td>99.125</td>\n",
       "      <td>1.402270</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>179</td>\n",
       "      <td>100.750</td>\n",
       "      <td>1.776675</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>33</td>\n",
       "      <td>103.375</td>\n",
       "      <td>0.319226</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>56</td>\n",
       "      <td>106.625</td>\n",
       "      <td>0.525205</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>152</td>\n",
       "      <td>108.500</td>\n",
       "      <td>1.400922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>192</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>35</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year  Season    Y        M       Y/M\n",
       "0      1       1   29      NaN       NaN\n",
       "1      1       2   90      NaN       NaN\n",
       "2      1       3  108   61.000  1.770492\n",
       "3      1       4   14   64.500  0.217054\n",
       "4      2       1   35   70.000  0.500000\n",
       "5      2       2  112   74.000  1.513514\n",
       "6      2       3  130   75.875  1.713344\n",
       "7      2       4   24   76.000  0.315789\n",
       "8      3       1   40   75.000  0.533333\n",
       "9      3       2  108   75.000  1.440000\n",
       "10     3       3  126   76.500  1.647059\n",
       "11     3       4   28   81.375  0.344086\n",
       "12     4       1   48   91.875  0.522449\n",
       "13     4       2  139   99.125  1.402270\n",
       "14     4       3  179  100.750  1.776675\n",
       "15     4       4   33  103.375  0.319226\n",
       "16     5       1   56  106.625  0.525205\n",
       "17     5       2  152  108.500  1.400922\n",
       "18     5       3  192      NaN       NaN\n",
       "19     5       4   35      NaN       NaN"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 计算趋势剔除值(Y/M)\n",
    "season_df.loc[:,'Y/M'] = season_df.apply(lambda x:x['Y']/x['M'] , axis=1)\n",
    "season_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Season\n",
       "1    0.520247\n",
       "2    1.439176\n",
       "3    1.726892\n",
       "4    0.299039\n",
       "Name: Y/M, dtype: float64"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 计算季节指数\n",
    "# 计算每年同季度的Y/M平均值，为方便表示，称之为未调整的季节指数\n",
    "unadjusted_S = season_df.groupby('Season')['Y/M'].mean()\n",
    "unadjusted_S"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Season\n",
       "1    0.522159\n",
       "2    1.444465\n",
       "3    1.733238\n",
       "4    0.300138\n",
       "Name: S, dtype: float64"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 对未调整的季节指数进行调整得到四个季度的季节指数S\n",
    "S = unadjusted_S / unadjusted_S.sum() * 4\n",
    "S.name = 'S'\n",
    "S"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 实验7-6 循环变动的测定"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Season</th>\n",
       "      <th>Y</th>\n",
       "      <th>M</th>\n",
       "      <th>Y/M</th>\n",
       "      <th>S</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.522159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>90</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.444465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>108</td>\n",
       "      <td>61.000</td>\n",
       "      <td>1.770492</td>\n",
       "      <td>1.733238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>14</td>\n",
       "      <td>64.500</td>\n",
       "      <td>0.217054</td>\n",
       "      <td>0.300138</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>35</td>\n",
       "      <td>70.000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.522159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>112</td>\n",
       "      <td>74.000</td>\n",
       "      <td>1.513514</td>\n",
       "      <td>1.444465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>130</td>\n",
       "      <td>75.875</td>\n",
       "      <td>1.713344</td>\n",
       "      <td>1.733238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>24</td>\n",
       "      <td>76.000</td>\n",
       "      <td>0.315789</td>\n",
       "      <td>0.300138</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>40</td>\n",
       "      <td>75.000</td>\n",
       "      <td>0.533333</td>\n",
       "      <td>0.522159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>108</td>\n",
       "      <td>75.000</td>\n",
       "      <td>1.440000</td>\n",
       "      <td>1.444465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>126</td>\n",
       "      <td>76.500</td>\n",
       "      <td>1.647059</td>\n",
       "      <td>1.733238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>28</td>\n",
       "      <td>81.375</td>\n",
       "      <td>0.344086</td>\n",
       "      <td>0.300138</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>48</td>\n",
       "      <td>91.875</td>\n",
       "      <td>0.522449</td>\n",
       "      <td>0.522159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>139</td>\n",
       "      <td>99.125</td>\n",
       "      <td>1.402270</td>\n",
       "      <td>1.444465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>179</td>\n",
       "      <td>100.750</td>\n",
       "      <td>1.776675</td>\n",
       "      <td>1.733238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>33</td>\n",
       "      <td>103.375</td>\n",
       "      <td>0.319226</td>\n",
       "      <td>0.300138</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>56</td>\n",
       "      <td>106.625</td>\n",
       "      <td>0.525205</td>\n",
       "      <td>0.522159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>152</td>\n",
       "      <td>108.500</td>\n",
       "      <td>1.400922</td>\n",
       "      <td>1.444465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>192</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.733238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>35</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.300138</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year  Season    Y        M       Y/M         S\n",
       "0      1       1   29      NaN       NaN  0.522159\n",
       "1      1       2   90      NaN       NaN  1.444465\n",
       "2      1       3  108   61.000  1.770492  1.733238\n",
       "3      1       4   14   64.500  0.217054  0.300138\n",
       "4      2       1   35   70.000  0.500000  0.522159\n",
       "5      2       2  112   74.000  1.513514  1.444465\n",
       "6      2       3  130   75.875  1.713344  1.733238\n",
       "7      2       4   24   76.000  0.315789  0.300138\n",
       "8      3       1   40   75.000  0.533333  0.522159\n",
       "9      3       2  108   75.000  1.440000  1.444465\n",
       "10     3       3  126   76.500  1.647059  1.733238\n",
       "11     3       4   28   81.375  0.344086  0.300138\n",
       "12     4       1   48   91.875  0.522449  0.522159\n",
       "13     4       2  139   99.125  1.402270  1.444465\n",
       "14     4       3  179  100.750  1.776675  1.733238\n",
       "15     4       4   33  103.375  0.319226  0.300138\n",
       "16     5       1   56  106.625  0.525205  0.522159\n",
       "17     5       2  152  108.500  1.400922  1.444465\n",
       "18     5       3  192      NaN       NaN  1.733238\n",
       "19     5       4   35      NaN       NaN  0.300138"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "S_df = S.to_frame().reset_index()\n",
    "season_df = season_df.merge(S_df , how='left' , on=['Season'])\n",
    "season_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Season</th>\n",
       "      <th>Y</th>\n",
       "      <th>M</th>\n",
       "      <th>Y/M</th>\n",
       "      <th>S</th>\n",
       "      <th>TCI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>55.538673</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>90</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>62.306807</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>108</td>\n",
       "      <td>61.000</td>\n",
       "      <td>1.770492</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>62.311102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>14</td>\n",
       "      <td>64.500</td>\n",
       "      <td>0.217054</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>46.645228</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>35</td>\n",
       "      <td>70.000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>67.029433</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>112</td>\n",
       "      <td>74.000</td>\n",
       "      <td>1.513514</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>77.537360</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>130</td>\n",
       "      <td>75.875</td>\n",
       "      <td>1.713344</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>75.004105</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>24</td>\n",
       "      <td>76.000</td>\n",
       "      <td>0.315789</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>79.963248</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>40</td>\n",
       "      <td>75.000</td>\n",
       "      <td>0.533333</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>76.605066</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>108</td>\n",
       "      <td>75.000</td>\n",
       "      <td>1.440000</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>74.768169</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>126</td>\n",
       "      <td>76.500</td>\n",
       "      <td>1.647059</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>72.696286</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>28</td>\n",
       "      <td>81.375</td>\n",
       "      <td>0.344086</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>93.290457</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>48</td>\n",
       "      <td>91.875</td>\n",
       "      <td>0.522449</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>91.926079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>139</td>\n",
       "      <td>99.125</td>\n",
       "      <td>1.402270</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>96.229402</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>179</td>\n",
       "      <td>100.750</td>\n",
       "      <td>1.776675</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>103.274882</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>33</td>\n",
       "      <td>103.375</td>\n",
       "      <td>0.319226</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>109.949467</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>56</td>\n",
       "      <td>106.625</td>\n",
       "      <td>0.525205</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>107.247092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>152</td>\n",
       "      <td>108.500</td>\n",
       "      <td>1.400922</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>105.229274</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>192</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>110.775293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>35</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>116.613071</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year  Season    Y        M       Y/M         S         TCI\n",
       "0      1       1   29      NaN       NaN  0.522159   55.538673\n",
       "1      1       2   90      NaN       NaN  1.444465   62.306807\n",
       "2      1       3  108   61.000  1.770492  1.733238   62.311102\n",
       "3      1       4   14   64.500  0.217054  0.300138   46.645228\n",
       "4      2       1   35   70.000  0.500000  0.522159   67.029433\n",
       "5      2       2  112   74.000  1.513514  1.444465   77.537360\n",
       "6      2       3  130   75.875  1.713344  1.733238   75.004105\n",
       "7      2       4   24   76.000  0.315789  0.300138   79.963248\n",
       "8      3       1   40   75.000  0.533333  0.522159   76.605066\n",
       "9      3       2  108   75.000  1.440000  1.444465   74.768169\n",
       "10     3       3  126   76.500  1.647059  1.733238   72.696286\n",
       "11     3       4   28   81.375  0.344086  0.300138   93.290457\n",
       "12     4       1   48   91.875  0.522449  0.522159   91.926079\n",
       "13     4       2  139   99.125  1.402270  1.444465   96.229402\n",
       "14     4       3  179  100.750  1.776675  1.733238  103.274882\n",
       "15     4       4   33  103.375  0.319226  0.300138  109.949467\n",
       "16     5       1   56  106.625  0.525205  0.522159  107.247092\n",
       "17     5       2  152  108.500  1.400922  1.444465  105.229274\n",
       "18     5       3  192      NaN       NaN  1.733238  110.775293\n",
       "19     5       4   35      NaN       NaN  0.300138  116.613071"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 计算分离季节变动后的销售预测序列TCI = Y/S\n",
    "season_df.loc[:,'TCI'] = season_df.apply(lambda x: x['Y'] / x['S'] , axis=1)\n",
    "season_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 3.29030694, 49.69880186])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 计算分离季节变动后的销售序列TCI的长期趋势T\n",
    "\n",
    "t = season_df.index + 1\n",
    "TCI = season_df.loc[:,'TCI']\n",
    "params = np.polyfit(t , TCI , deg = 1)\n",
    "params"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Season</th>\n",
       "      <th>Y</th>\n",
       "      <th>M</th>\n",
       "      <th>Y/M</th>\n",
       "      <th>S</th>\n",
       "      <th>TCI</th>\n",
       "      <th>T</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>55.538673</td>\n",
       "      <td>52.989109</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>90</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>62.306807</td>\n",
       "      <td>56.279416</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>108</td>\n",
       "      <td>61.000</td>\n",
       "      <td>1.770492</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>62.311102</td>\n",
       "      <td>59.569723</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>14</td>\n",
       "      <td>64.500</td>\n",
       "      <td>0.217054</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>46.645228</td>\n",
       "      <td>62.860030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>35</td>\n",
       "      <td>70.000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>67.029433</td>\n",
       "      <td>66.150337</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>112</td>\n",
       "      <td>74.000</td>\n",
       "      <td>1.513514</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>77.537360</td>\n",
       "      <td>69.440644</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>130</td>\n",
       "      <td>75.875</td>\n",
       "      <td>1.713344</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>75.004105</td>\n",
       "      <td>72.730950</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>24</td>\n",
       "      <td>76.000</td>\n",
       "      <td>0.315789</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>79.963248</td>\n",
       "      <td>76.021257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>40</td>\n",
       "      <td>75.000</td>\n",
       "      <td>0.533333</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>76.605066</td>\n",
       "      <td>79.311564</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>108</td>\n",
       "      <td>75.000</td>\n",
       "      <td>1.440000</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>74.768169</td>\n",
       "      <td>82.601871</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>126</td>\n",
       "      <td>76.500</td>\n",
       "      <td>1.647059</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>72.696286</td>\n",
       "      <td>85.892178</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>28</td>\n",
       "      <td>81.375</td>\n",
       "      <td>0.344086</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>93.290457</td>\n",
       "      <td>89.182485</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>48</td>\n",
       "      <td>91.875</td>\n",
       "      <td>0.522449</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>91.926079</td>\n",
       "      <td>92.472792</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>139</td>\n",
       "      <td>99.125</td>\n",
       "      <td>1.402270</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>96.229402</td>\n",
       "      <td>95.763099</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>179</td>\n",
       "      <td>100.750</td>\n",
       "      <td>1.776675</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>103.274882</td>\n",
       "      <td>99.053406</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>33</td>\n",
       "      <td>103.375</td>\n",
       "      <td>0.319226</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>109.949467</td>\n",
       "      <td>102.343713</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>56</td>\n",
       "      <td>106.625</td>\n",
       "      <td>0.525205</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>107.247092</td>\n",
       "      <td>105.634020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>152</td>\n",
       "      <td>108.500</td>\n",
       "      <td>1.400922</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>105.229274</td>\n",
       "      <td>108.924327</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>192</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>110.775293</td>\n",
       "      <td>112.214634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>35</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>116.613071</td>\n",
       "      <td>115.504941</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year  Season    Y        M       Y/M         S         TCI           T\n",
       "0      1       1   29      NaN       NaN  0.522159   55.538673   52.989109\n",
       "1      1       2   90      NaN       NaN  1.444465   62.306807   56.279416\n",
       "2      1       3  108   61.000  1.770492  1.733238   62.311102   59.569723\n",
       "3      1       4   14   64.500  0.217054  0.300138   46.645228   62.860030\n",
       "4      2       1   35   70.000  0.500000  0.522159   67.029433   66.150337\n",
       "5      2       2  112   74.000  1.513514  1.444465   77.537360   69.440644\n",
       "6      2       3  130   75.875  1.713344  1.733238   75.004105   72.730950\n",
       "7      2       4   24   76.000  0.315789  0.300138   79.963248   76.021257\n",
       "8      3       1   40   75.000  0.533333  0.522159   76.605066   79.311564\n",
       "9      3       2  108   75.000  1.440000  1.444465   74.768169   82.601871\n",
       "10     3       3  126   76.500  1.647059  1.733238   72.696286   85.892178\n",
       "11     3       4   28   81.375  0.344086  0.300138   93.290457   89.182485\n",
       "12     4       1   48   91.875  0.522449  0.522159   91.926079   92.472792\n",
       "13     4       2  139   99.125  1.402270  1.444465   96.229402   95.763099\n",
       "14     4       3  179  100.750  1.776675  1.733238  103.274882   99.053406\n",
       "15     4       4   33  103.375  0.319226  0.300138  109.949467  102.343713\n",
       "16     5       1   56  106.625  0.525205  0.522159  107.247092  105.634020\n",
       "17     5       2  152  108.500  1.400922  1.444465  105.229274  108.924327\n",
       "18     5       3  192      NaN       NaN  1.733238  110.775293  112.214634\n",
       "19     5       4   35      NaN       NaN  0.300138  116.613071  115.504941"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 估计长期趋势T\n",
    "season_df.loc[:,'T'] = np.polyval(params,t)\n",
    "season_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Season</th>\n",
       "      <th>Y</th>\n",
       "      <th>M</th>\n",
       "      <th>Y/M</th>\n",
       "      <th>S</th>\n",
       "      <th>TCI</th>\n",
       "      <th>T</th>\n",
       "      <th>CI</th>\n",
       "      <th>C</th>\n",
       "      <th>I</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>55.538673</td>\n",
       "      <td>52.989109</td>\n",
       "      <td>1.048115</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>90</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>62.306807</td>\n",
       "      <td>56.279416</td>\n",
       "      <td>1.107098</td>\n",
       "      <td>1.067077</td>\n",
       "      <td>1.037505</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>108</td>\n",
       "      <td>61.000</td>\n",
       "      <td>1.770492</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>62.311102</td>\n",
       "      <td>59.569723</td>\n",
       "      <td>1.046020</td>\n",
       "      <td>0.965055</td>\n",
       "      <td>1.083896</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>14</td>\n",
       "      <td>64.500</td>\n",
       "      <td>0.217054</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>46.645228</td>\n",
       "      <td>62.860030</td>\n",
       "      <td>0.742049</td>\n",
       "      <td>0.933786</td>\n",
       "      <td>0.794667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>35</td>\n",
       "      <td>70.000</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>67.029433</td>\n",
       "      <td>66.150337</td>\n",
       "      <td>1.013289</td>\n",
       "      <td>0.957313</td>\n",
       "      <td>1.058473</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>112</td>\n",
       "      <td>74.000</td>\n",
       "      <td>1.513514</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>77.537360</td>\n",
       "      <td>69.440644</td>\n",
       "      <td>1.116599</td>\n",
       "      <td>1.053714</td>\n",
       "      <td>1.059679</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>130</td>\n",
       "      <td>75.875</td>\n",
       "      <td>1.713344</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>75.004105</td>\n",
       "      <td>72.730950</td>\n",
       "      <td>1.031254</td>\n",
       "      <td>1.066569</td>\n",
       "      <td>0.966889</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>24</td>\n",
       "      <td>76.000</td>\n",
       "      <td>0.315789</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>79.963248</td>\n",
       "      <td>76.021257</td>\n",
       "      <td>1.051854</td>\n",
       "      <td>1.016328</td>\n",
       "      <td>1.034955</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>40</td>\n",
       "      <td>75.000</td>\n",
       "      <td>0.533333</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>76.605066</td>\n",
       "      <td>79.311564</td>\n",
       "      <td>0.965875</td>\n",
       "      <td>0.974297</td>\n",
       "      <td>0.991356</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>108</td>\n",
       "      <td>75.000</td>\n",
       "      <td>1.440000</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>74.768169</td>\n",
       "      <td>82.601871</td>\n",
       "      <td>0.905163</td>\n",
       "      <td>0.905802</td>\n",
       "      <td>0.999295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>126</td>\n",
       "      <td>76.500</td>\n",
       "      <td>1.647059</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>72.696286</td>\n",
       "      <td>85.892178</td>\n",
       "      <td>0.846367</td>\n",
       "      <td>0.932531</td>\n",
       "      <td>0.907602</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>28</td>\n",
       "      <td>81.375</td>\n",
       "      <td>0.344086</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>93.290457</td>\n",
       "      <td>89.182485</td>\n",
       "      <td>1.046063</td>\n",
       "      <td>0.962172</td>\n",
       "      <td>1.087188</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>48</td>\n",
       "      <td>91.875</td>\n",
       "      <td>0.522449</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>91.926079</td>\n",
       "      <td>92.472792</td>\n",
       "      <td>0.994088</td>\n",
       "      <td>1.015007</td>\n",
       "      <td>0.979391</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>139</td>\n",
       "      <td>99.125</td>\n",
       "      <td>1.402270</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>96.229402</td>\n",
       "      <td>95.763099</td>\n",
       "      <td>1.004869</td>\n",
       "      <td>1.013858</td>\n",
       "      <td>0.991134</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>179</td>\n",
       "      <td>100.750</td>\n",
       "      <td>1.776675</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>103.274882</td>\n",
       "      <td>99.053406</td>\n",
       "      <td>1.042618</td>\n",
       "      <td>1.040601</td>\n",
       "      <td>1.001938</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>33</td>\n",
       "      <td>103.375</td>\n",
       "      <td>0.319226</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>109.949467</td>\n",
       "      <td>102.343713</td>\n",
       "      <td>1.074316</td>\n",
       "      <td>1.044068</td>\n",
       "      <td>1.028971</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>56</td>\n",
       "      <td>106.625</td>\n",
       "      <td>0.525205</td>\n",
       "      <td>0.522159</td>\n",
       "      <td>107.247092</td>\n",
       "      <td>105.634020</td>\n",
       "      <td>1.015270</td>\n",
       "      <td>1.018554</td>\n",
       "      <td>0.996776</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>152</td>\n",
       "      <td>108.500</td>\n",
       "      <td>1.400922</td>\n",
       "      <td>1.444465</td>\n",
       "      <td>105.229274</td>\n",
       "      <td>108.924327</td>\n",
       "      <td>0.966077</td>\n",
       "      <td>0.989507</td>\n",
       "      <td>0.976322</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>192</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.733238</td>\n",
       "      <td>110.775293</td>\n",
       "      <td>112.214634</td>\n",
       "      <td>0.987173</td>\n",
       "      <td>0.987615</td>\n",
       "      <td>0.999553</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>35</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.300138</td>\n",
       "      <td>116.613071</td>\n",
       "      <td>115.504941</td>\n",
       "      <td>1.009594</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year  Season    Y        M       Y/M         S         TCI           T  \\\n",
       "0      1       1   29      NaN       NaN  0.522159   55.538673   52.989109   \n",
       "1      1       2   90      NaN       NaN  1.444465   62.306807   56.279416   \n",
       "2      1       3  108   61.000  1.770492  1.733238   62.311102   59.569723   \n",
       "3      1       4   14   64.500  0.217054  0.300138   46.645228   62.860030   \n",
       "4      2       1   35   70.000  0.500000  0.522159   67.029433   66.150337   \n",
       "5      2       2  112   74.000  1.513514  1.444465   77.537360   69.440644   \n",
       "6      2       3  130   75.875  1.713344  1.733238   75.004105   72.730950   \n",
       "7      2       4   24   76.000  0.315789  0.300138   79.963248   76.021257   \n",
       "8      3       1   40   75.000  0.533333  0.522159   76.605066   79.311564   \n",
       "9      3       2  108   75.000  1.440000  1.444465   74.768169   82.601871   \n",
       "10     3       3  126   76.500  1.647059  1.733238   72.696286   85.892178   \n",
       "11     3       4   28   81.375  0.344086  0.300138   93.290457   89.182485   \n",
       "12     4       1   48   91.875  0.522449  0.522159   91.926079   92.472792   \n",
       "13     4       2  139   99.125  1.402270  1.444465   96.229402   95.763099   \n",
       "14     4       3  179  100.750  1.776675  1.733238  103.274882   99.053406   \n",
       "15     4       4   33  103.375  0.319226  0.300138  109.949467  102.343713   \n",
       "16     5       1   56  106.625  0.525205  0.522159  107.247092  105.634020   \n",
       "17     5       2  152  108.500  1.400922  1.444465  105.229274  108.924327   \n",
       "18     5       3  192      NaN       NaN  1.733238  110.775293  112.214634   \n",
       "19     5       4   35      NaN       NaN  0.300138  116.613071  115.504941   \n",
       "\n",
       "          CI         C         I  \n",
       "0   1.048115       NaN       NaN  \n",
       "1   1.107098  1.067077  1.037505  \n",
       "2   1.046020  0.965055  1.083896  \n",
       "3   0.742049  0.933786  0.794667  \n",
       "4   1.013289  0.957313  1.058473  \n",
       "5   1.116599  1.053714  1.059679  \n",
       "6   1.031254  1.066569  0.966889  \n",
       "7   1.051854  1.016328  1.034955  \n",
       "8   0.965875  0.974297  0.991356  \n",
       "9   0.905163  0.905802  0.999295  \n",
       "10  0.846367  0.932531  0.907602  \n",
       "11  1.046063  0.962172  1.087188  \n",
       "12  0.994088  1.015007  0.979391  \n",
       "13  1.004869  1.013858  0.991134  \n",
       "14  1.042618  1.040601  1.001938  \n",
       "15  1.074316  1.044068  1.028971  \n",
       "16  1.015270  1.018554  0.996776  \n",
       "17  0.966077  0.989507  0.976322  \n",
       "18  0.987173  0.987615  0.999553  \n",
       "19  1.009594       NaN       NaN  "
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 剔除长期趋势，CI = TCI/T\n",
    "season_df.loc[:,'CI'] = season_df.apply(lambda x :x['TCI'] / x['T'] , axis=1)\n",
    "\n",
    "# 清除不规则变动，得到C\n",
    "season_df.loc[:,'C'] = season_df.loc[:,'CI'].rolling(window=3,center=True).mean()\n",
    "\n",
    "# 计算不规则变动，I=CI/C\n",
    "season_df.loc[:,'I'] = season_df.apply(lambda x: x['CI'] / x['C'] , axis=1)\n",
    "\n",
    "season_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第四节 时间序列预测"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 实验7-7 时间序列模型的预测"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "根据数据，利用指数平滑法预测2005年和2006年的销售量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Q</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1993</td>\n",
       "      <td>54.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1994</td>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1995</td>\n",
       "      <td>52.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1996</td>\n",
       "      <td>67.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1997</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1998</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1999</td>\n",
       "      <td>89.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2000</td>\n",
       "      <td>88.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2001</td>\n",
       "      <td>84.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2002</td>\n",
       "      <td>98.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2003</td>\n",
       "      <td>91.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2004</td>\n",
       "      <td>106.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2005</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2006</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year      Q\n",
       "0   1993   54.0\n",
       "1   1994   50.0\n",
       "2   1995   52.0\n",
       "3   1996   67.0\n",
       "4   1997   82.0\n",
       "5   1998   70.0\n",
       "6   1999   89.0\n",
       "7   2000   88.0\n",
       "8   2001   84.0\n",
       "9   2002   98.0\n",
       "10  2003   91.0\n",
       "11  2004  106.0\n",
       "12  2005    NaN\n",
       "13  2006    NaN"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "source_df = pd.read_excel('7-7.xlsx')\n",
    "source_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Q</th>\n",
       "      <th>E1</th>\n",
       "      <th>E2</th>\n",
       "      <th>at</th>\n",
       "      <th>bt</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1993</td>\n",
       "      <td>54.0</td>\n",
       "      <td>54.000000</td>\n",
       "      <td>54.000000</td>\n",
       "      <td>54.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1994</td>\n",
       "      <td>50.0</td>\n",
       "      <td>52.200000</td>\n",
       "      <td>53.190000</td>\n",
       "      <td>51.210000</td>\n",
       "      <td>-0.810000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1995</td>\n",
       "      <td>52.0</td>\n",
       "      <td>52.110000</td>\n",
       "      <td>52.704000</td>\n",
       "      <td>51.516000</td>\n",
       "      <td>-0.486000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1996</td>\n",
       "      <td>67.0</td>\n",
       "      <td>58.810500</td>\n",
       "      <td>55.451925</td>\n",
       "      <td>62.169075</td>\n",
       "      <td>2.747925</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1997</td>\n",
       "      <td>82.0</td>\n",
       "      <td>69.245775</td>\n",
       "      <td>61.659158</td>\n",
       "      <td>76.832393</td>\n",
       "      <td>6.207233</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1998</td>\n",
       "      <td>70.0</td>\n",
       "      <td>69.585176</td>\n",
       "      <td>65.225866</td>\n",
       "      <td>73.944487</td>\n",
       "      <td>3.566708</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1999</td>\n",
       "      <td>89.0</td>\n",
       "      <td>78.321847</td>\n",
       "      <td>71.119057</td>\n",
       "      <td>85.524636</td>\n",
       "      <td>5.893191</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2000</td>\n",
       "      <td>88.0</td>\n",
       "      <td>82.677016</td>\n",
       "      <td>76.320139</td>\n",
       "      <td>89.033893</td>\n",
       "      <td>5.201081</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2001</td>\n",
       "      <td>84.0</td>\n",
       "      <td>83.272359</td>\n",
       "      <td>79.448638</td>\n",
       "      <td>87.096080</td>\n",
       "      <td>3.128499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2002</td>\n",
       "      <td>98.0</td>\n",
       "      <td>89.899797</td>\n",
       "      <td>84.151660</td>\n",
       "      <td>95.647935</td>\n",
       "      <td>4.703022</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2003</td>\n",
       "      <td>91.0</td>\n",
       "      <td>90.394889</td>\n",
       "      <td>86.961113</td>\n",
       "      <td>93.828664</td>\n",
       "      <td>2.809453</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2004</td>\n",
       "      <td>106.0</td>\n",
       "      <td>97.417189</td>\n",
       "      <td>91.666347</td>\n",
       "      <td>103.168031</td>\n",
       "      <td>4.705234</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2005</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year      Q         E1         E2          at        bt\n",
       "0   1993   54.0  54.000000  54.000000   54.000000  0.000000\n",
       "1   1994   50.0  52.200000  53.190000   51.210000 -0.810000\n",
       "2   1995   52.0  52.110000  52.704000   51.516000 -0.486000\n",
       "3   1996   67.0  58.810500  55.451925   62.169075  2.747925\n",
       "4   1997   82.0  69.245775  61.659158   76.832393  6.207233\n",
       "5   1998   70.0  69.585176  65.225866   73.944487  3.566708\n",
       "6   1999   89.0  78.321847  71.119057   85.524636  5.893191\n",
       "7   2000   88.0  82.677016  76.320139   89.033893  5.201081\n",
       "8   2001   84.0  83.272359  79.448638   87.096080  3.128499\n",
       "9   2002   98.0  89.899797  84.151660   95.647935  4.703022\n",
       "10  2003   91.0  90.394889  86.961113   93.828664  2.809453\n",
       "11  2004  106.0  97.417189  91.666347  103.168031  4.705234\n",
       "12  2005    NaN        NaN        NaN         NaN       NaN\n",
       "13  2006    NaN        NaN        NaN         NaN       NaN"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alpha = 0.45\n",
    "source_df.loc[:11,'E1'] = source_df.loc[:,'Q'].ewm(alpha=alpha , adjust = False).mean()\n",
    "source_df.loc[:11,'E2'] = source_df.loc[:,'E1'].ewm(alpha=0.45 , adjust = False).mean()\n",
    "source_df.loc[:11,'at'] = source_df.apply(lambda x: 2*x['E1'] - x['E2'] , axis=1)\n",
    "source_df.loc[:11,'bt'] = source_df.apply(lambda x: alpha / (1-alpha)*(x['E1'] - x['E2']) , axis=1)\n",
    "\n",
    "source_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Q</th>\n",
       "      <th>E1</th>\n",
       "      <th>E2</th>\n",
       "      <th>at</th>\n",
       "      <th>bt</th>\n",
       "      <th>yt</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1993</td>\n",
       "      <td>54.0</td>\n",
       "      <td>54.000000</td>\n",
       "      <td>54.000000</td>\n",
       "      <td>54.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1994</td>\n",
       "      <td>50.0</td>\n",
       "      <td>52.200000</td>\n",
       "      <td>53.190000</td>\n",
       "      <td>51.210000</td>\n",
       "      <td>-0.810000</td>\n",
       "      <td>54.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1995</td>\n",
       "      <td>52.0</td>\n",
       "      <td>52.110000</td>\n",
       "      <td>52.704000</td>\n",
       "      <td>51.516000</td>\n",
       "      <td>-0.486000</td>\n",
       "      <td>50.400000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1996</td>\n",
       "      <td>67.0</td>\n",
       "      <td>58.810500</td>\n",
       "      <td>55.451925</td>\n",
       "      <td>62.169075</td>\n",
       "      <td>2.747925</td>\n",
       "      <td>51.030000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1997</td>\n",
       "      <td>82.0</td>\n",
       "      <td>69.245775</td>\n",
       "      <td>61.659158</td>\n",
       "      <td>76.832393</td>\n",
       "      <td>6.207233</td>\n",
       "      <td>64.917000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1998</td>\n",
       "      <td>70.0</td>\n",
       "      <td>69.585176</td>\n",
       "      <td>65.225866</td>\n",
       "      <td>73.944487</td>\n",
       "      <td>3.566708</td>\n",
       "      <td>83.039625</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1999</td>\n",
       "      <td>89.0</td>\n",
       "      <td>78.321847</td>\n",
       "      <td>71.119057</td>\n",
       "      <td>85.524636</td>\n",
       "      <td>5.893191</td>\n",
       "      <td>77.511195</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2000</td>\n",
       "      <td>88.0</td>\n",
       "      <td>82.677016</td>\n",
       "      <td>76.320139</td>\n",
       "      <td>89.033893</td>\n",
       "      <td>5.201081</td>\n",
       "      <td>91.417828</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2001</td>\n",
       "      <td>84.0</td>\n",
       "      <td>83.272359</td>\n",
       "      <td>79.448638</td>\n",
       "      <td>87.096080</td>\n",
       "      <td>3.128499</td>\n",
       "      <td>94.234974</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2002</td>\n",
       "      <td>98.0</td>\n",
       "      <td>89.899797</td>\n",
       "      <td>84.151660</td>\n",
       "      <td>95.647935</td>\n",
       "      <td>4.703022</td>\n",
       "      <td>90.224579</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2003</td>\n",
       "      <td>91.0</td>\n",
       "      <td>90.394889</td>\n",
       "      <td>86.961113</td>\n",
       "      <td>93.828664</td>\n",
       "      <td>2.809453</td>\n",
       "      <td>100.350957</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2004</td>\n",
       "      <td>106.0</td>\n",
       "      <td>97.417189</td>\n",
       "      <td>91.666347</td>\n",
       "      <td>103.168031</td>\n",
       "      <td>4.705234</td>\n",
       "      <td>96.638118</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2005</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>107.873265</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>112.578499</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year      Q         E1         E2          at        bt          yt\n",
       "0   1993   54.0  54.000000  54.000000   54.000000  0.000000         NaN\n",
       "1   1994   50.0  52.200000  53.190000   51.210000 -0.810000   54.000000\n",
       "2   1995   52.0  52.110000  52.704000   51.516000 -0.486000   50.400000\n",
       "3   1996   67.0  58.810500  55.451925   62.169075  2.747925   51.030000\n",
       "4   1997   82.0  69.245775  61.659158   76.832393  6.207233   64.917000\n",
       "5   1998   70.0  69.585176  65.225866   73.944487  3.566708   83.039625\n",
       "6   1999   89.0  78.321847  71.119057   85.524636  5.893191   77.511195\n",
       "7   2000   88.0  82.677016  76.320139   89.033893  5.201081   91.417828\n",
       "8   2001   84.0  83.272359  79.448638   87.096080  3.128499   94.234974\n",
       "9   2002   98.0  89.899797  84.151660   95.647935  4.703022   90.224579\n",
       "10  2003   91.0  90.394889  86.961113   93.828664  2.809453  100.350957\n",
       "11  2004  106.0  97.417189  91.666347  103.168031  4.705234   96.638118\n",
       "12  2005    NaN        NaN        NaN         NaN       NaN  107.873265\n",
       "13  2006    NaN        NaN        NaN         NaN       NaN  112.578499"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 计算预测值y\n",
    "source_df.loc[:12,'yt'] = source_df.apply(lambda x:x['at'] + x['bt'] , axis=1).shift()\n",
    "source_df.loc[13,'yt'] = source_df.loc[12,'yt'] + source_df.loc[11,'bt']\n",
    "\n",
    "source_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "由结果可得，2005年和2006年销量分别为107.873265和112.578499"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "        <script type=\"text/javascript\">\n",
       "        window.PlotlyConfig = {MathJaxConfig: 'local'};\n",
       "        if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n",
       "        if (typeof require !== 'undefined') {\n",
       "        require.undef(\"plotly\");\n",
       "        requirejs.config({\n",
       "            paths: {\n",
       "                'plotly': ['https://cdn.plot.ly/plotly-latest.min']\n",
       "            }\n",
       "        });\n",
       "        require(['plotly'], function(Plotly) {\n",
       "            window._Plotly = Plotly;\n",
       "        });\n",
       "        }\n",
       "        </script>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "        <script type=\"text/javascript\">\n",
       "        window.PlotlyConfig = {MathJaxConfig: 'local'};\n",
       "        if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n",
       "        if (typeof require !== 'undefined') {\n",
       "        require.undef(\"plotly\");\n",
       "        requirejs.config({\n",
       "            paths: {\n",
       "                'plotly': ['https://cdn.plot.ly/plotly-latest.min']\n",
       "            }\n",
       "        });\n",
       "        require(['plotly'], function(Plotly) {\n",
       "            window._Plotly = Plotly;\n",
       "        });\n",
       "        }\n",
       "        </script>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import cufflinks as cf\n",
    "# 如果使用online模式，那么生成的图形是有限制的。所以，我们这里先设置为offline模式，这样就避免了出现次数限制问题。\n",
    "cf.set_config_file(offline=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "linkText": "Export to plot.ly",
        "plotlyServerURL": "https://plot.ly",
        "showLink": true
       },
       "data": [
        {
         "line": {
          "color": "rgba(255, 153, 51, 1.0)",
          "dash": "solid",
          "shape": "linear",
          "width": 1.3
         },
         "mode": "lines",
         "name": "Q",
         "text": "",
         "type": "scatter",
         "x": [
          1993,
          1994,
          1995,
          1996,
          1997,
          1998,
          1999,
          2000,
          2001,
          2002,
          2003,
          2004,
          2005,
          2006
         ],
         "y": [
          54,
          50,
          52,
          67,
          82,
          70,
          89,
          88,
          84,
          98,
          91,
          106,
          "",
          ""
         ]
        },
        {
         "line": {
          "color": "rgba(55, 128, 191, 1.0)",
          "dash": "solid",
          "shape": "linear",
          "width": 1.3
         },
         "mode": "lines",
         "name": "E1",
         "text": "",
         "type": "scatter",
         "x": [
          1993,
          1994,
          1995,
          1996,
          1997,
          1998,
          1999,
          2000,
          2001,
          2002,
          2003,
          2004,
          2005,
          2006
         ],
         "y": [
          54,
          52.2,
          52.11,
          58.810500000000005,
          69.24577500000001,
          69.58517625,
          78.3218469375,
          82.677015815625,
          83.27235869859375,
          89.89979728422657,
          90.3948885063246,
          97.41718867847854,
          "",
          ""
         ]
        },
        {
         "line": {
          "color": "rgba(50, 171, 96, 1.0)",
          "dash": "solid",
          "shape": "linear",
          "width": 1.3
         },
         "mode": "lines",
         "name": "E2",
         "text": "",
         "type": "scatter",
         "x": [
          1993,
          1994,
          1995,
          1996,
          1997,
          1998,
          1999,
          2000,
          2001,
          2002,
          2003,
          2004,
          2005,
          2006
         ],
         "y": [
          54,
          53.19,
          52.70399999999999,
          55.451924999999996,
          61.659157500000006,
          65.2258659375,
          71.11905738749999,
          76.32013868015625,
          79.44863768845312,
          84.15165950655117,
          86.96111255644922,
          91.66634681136242,
          "",
          ""
         ]
        },
        {
         "line": {
          "color": "rgba(128, 0, 128, 1.0)",
          "dash": "solid",
          "shape": "linear",
          "width": 1.3
         },
         "mode": "lines",
         "name": "at",
         "text": "",
         "type": "scatter",
         "x": [
          1993,
          1994,
          1995,
          1996,
          1997,
          1998,
          1999,
          2000,
          2001,
          2002,
          2003,
          2004,
          2005,
          2006
         ],
         "y": [
          54,
          51.21000000000001,
          51.516000000000005,
          62.169075000000014,
          76.83239250000001,
          73.9444865625,
          85.5246364875,
          89.03389295109375,
          87.09607970873438,
          95.64793506190196,
          93.82866445619999,
          103.16803054559466,
          "",
          ""
         ]
        },
        {
         "line": {
          "color": "rgba(219, 64, 82, 1.0)",
          "dash": "solid",
          "shape": "linear",
          "width": 1.3
         },
         "mode": "lines",
         "name": "bt",
         "text": "",
         "type": "scatter",
         "x": [
          1993,
          1994,
          1995,
          1996,
          1997,
          1998,
          1999,
          2000,
          2001,
          2002,
          2003,
          2004,
          2005,
          2006
         ],
         "y": [
          0,
          -0.8099999999999957,
          -0.4859999999999951,
          2.747925000000007,
          6.207232500000002,
          3.5667084374999996,
          5.893191450000004,
          5.20108129265625,
          3.1284990082968793,
          4.703021818098051,
          2.80945304989804,
          4.705234254913191,
          "",
          ""
         ]
        },
        {
         "line": {
          "color": "rgba(0, 128, 128, 1.0)",
          "dash": "solid",
          "shape": "linear",
          "width": 1.3
         },
         "mode": "lines",
         "name": "yt",
         "text": "",
         "type": "scatter",
         "x": [
          1993,
          1994,
          1995,
          1996,
          1997,
          1998,
          1999,
          2000,
          2001,
          2002,
          2003,
          2004,
          2005,
          2006
         ],
         "y": [
          "",
          54,
          50.40000000000001,
          51.03000000000001,
          64.91700000000002,
          83.03962500000002,
          77.511195,
          91.41782793750001,
          94.23497424375,
          90.22457871703126,
          100.35095688000001,
          96.63811750609803,
          107.87326480050785,
          112.57849905542105
         ]
        }
       ],
       "layout": {
        "legend": {
         "bgcolor": "#F5F6F9",
         "font": {
          "color": "#4D5663"
         }
        },
        "paper_bgcolor": "#F5F6F9",
        "plot_bgcolor": "#F5F6F9",
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "scatter": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "font": {
          "color": "#4D5663"
         }
        },
        "xaxis": {
         "gridcolor": "#E1E5ED",
         "showgrid": true,
         "tickfont": {
          "color": "#4D5663"
         },
         "title": {
          "font": {
           "color": "#4D5663"
          },
          "text": ""
         },
         "zerolinecolor": "#E1E5ED"
        },
        "yaxis": {
         "gridcolor": "#E1E5ED",
         "showgrid": true,
         "tickfont": {
          "color": "#4D5663"
         },
         "title": {
          "font": {
           "color": "#4D5663"
          },
          "text": ""
         },
         "zerolinecolor": "#E1E5ED"
        }
       }
      },
      "text/html": [
       "<div>\n",
       "        \n",
       "        \n",
       "            <div id=\"673569eb-d1fb-4dde-8be7-e8b7df72b128\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>\n",
       "            <script type=\"text/javascript\">\n",
       "                require([\"plotly\"], function(Plotly) {\n",
       "                    window.PLOTLYENV=window.PLOTLYENV || {};\n",
       "                    window.PLOTLYENV.BASE_URL='https://plot.ly';\n",
       "                    \n",
       "                if (document.getElementById(\"673569eb-d1fb-4dde-8be7-e8b7df72b128\")) {\n",
       "                    Plotly.newPlot(\n",
       "                        '673569eb-d1fb-4dde-8be7-e8b7df72b128',\n",
       "                        [{\"line\": {\"color\": \"rgba(255, 153, 51, 1.0)\", \"dash\": \"solid\", \"shape\": \"linear\", \"width\": 1.3}, \"mode\": \"lines\", \"name\": \"Q\", \"text\": \"\", \"type\": \"scatter\", \"x\": [1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006], \"y\": [54.0, 50.0, 52.0, 67.0, 82.0, 70.0, 89.0, 88.0, 84.0, 98.0, 91.0, 106.0, \"\", \"\"]}, {\"line\": {\"color\": \"rgba(55, 128, 191, 1.0)\", \"dash\": \"solid\", \"shape\": \"linear\", \"width\": 1.3}, \"mode\": \"lines\", \"name\": \"E1\", \"text\": \"\", \"type\": \"scatter\", \"x\": [1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006], \"y\": [54.0, 52.2, 52.11, 58.810500000000005, 69.24577500000001, 69.58517625, 78.3218469375, 82.677015815625, 83.27235869859375, 89.89979728422657, 90.3948885063246, 97.41718867847854, \"\", \"\"]}, {\"line\": {\"color\": \"rgba(50, 171, 96, 1.0)\", \"dash\": \"solid\", \"shape\": \"linear\", \"width\": 1.3}, \"mode\": \"lines\", \"name\": \"E2\", \"text\": \"\", \"type\": \"scatter\", \"x\": [1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006], \"y\": [54.0, 53.19, 52.70399999999999, 55.451924999999996, 61.659157500000006, 65.2258659375, 71.11905738749999, 76.32013868015625, 79.44863768845312, 84.15165950655117, 86.96111255644922, 91.66634681136242, \"\", \"\"]}, {\"line\": {\"color\": \"rgba(128, 0, 128, 1.0)\", \"dash\": \"solid\", \"shape\": \"linear\", \"width\": 1.3}, \"mode\": \"lines\", \"name\": \"at\", \"text\": \"\", \"type\": \"scatter\", \"x\": [1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006], \"y\": [54.0, 51.21000000000001, 51.516000000000005, 62.169075000000014, 76.83239250000001, 73.9444865625, 85.5246364875, 89.03389295109375, 87.09607970873438, 95.64793506190196, 93.82866445619999, 103.16803054559466, \"\", \"\"]}, {\"line\": {\"color\": \"rgba(219, 64, 82, 1.0)\", \"dash\": \"solid\", \"shape\": \"linear\", \"width\": 1.3}, \"mode\": \"lines\", \"name\": \"bt\", \"text\": \"\", \"type\": \"scatter\", \"x\": [1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006], \"y\": [0.0, -0.8099999999999957, -0.4859999999999951, 2.747925000000007, 6.207232500000002, 3.5667084374999996, 5.893191450000004, 5.20108129265625, 3.1284990082968793, 4.703021818098051, 2.80945304989804, 4.705234254913191, \"\", \"\"]}, {\"line\": {\"color\": \"rgba(0, 128, 128, 1.0)\", \"dash\": \"solid\", \"shape\": \"linear\", \"width\": 1.3}, \"mode\": \"lines\", \"name\": \"yt\", \"text\": \"\", \"type\": \"scatter\", \"x\": [1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006], \"y\": [\"\", 54.0, 50.40000000000001, 51.03000000000001, 64.91700000000002, 83.03962500000002, 77.511195, 91.41782793750001, 94.23497424375, 90.22457871703126, 100.35095688000001, 96.63811750609803, 107.87326480050785, 112.57849905542105]}],\n",
       "                        {\"legend\": {\"bgcolor\": \"#F5F6F9\", \"font\": {\"color\": \"#4D5663\"}}, \"paper_bgcolor\": \"#F5F6F9\", \"plot_bgcolor\": \"#F5F6F9\", \"template\": {\"data\": {\"bar\": [{\"error_x\": {\"color\": \"#2a3f5f\"}, \"error_y\": {\"color\": \"#2a3f5f\"}, \"marker\": {\"line\": {\"color\": \"#E5ECF6\", \"width\": 0.5}}, \"type\": \"bar\"}], \"barpolar\": [{\"marker\": {\"line\": {\"color\": \"#E5ECF6\", \"width\": 0.5}}, \"type\": \"barpolar\"}], \"carpet\": [{\"aaxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"white\", \"linecolor\": \"white\", \"minorgridcolor\": \"white\", \"startlinecolor\": \"#2a3f5f\"}, \"baxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"white\", \"linecolor\": \"white\", \"minorgridcolor\": \"white\", \"startlinecolor\": \"#2a3f5f\"}, \"type\": \"carpet\"}], \"choropleth\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"choropleth\"}], \"contour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"contour\"}], \"contourcarpet\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"contourcarpet\"}], \"heatmap\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmap\"}], \"heatmapgl\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmapgl\"}], \"histogram\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"histogram\"}], \"histogram2d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2d\"}], \"histogram2dcontour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2dcontour\"}], \"mesh3d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"mesh3d\"}], \"parcoords\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"parcoords\"}], \"scatter\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter\"}], \"scatter3d\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter3d\"}], \"scattercarpet\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattercarpet\"}], \"scattergeo\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergeo\"}], \"scattergl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergl\"}], \"scattermapbox\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattermapbox\"}], \"scatterpolar\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolar\"}], \"scatterpolargl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolargl\"}], \"scatterternary\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterternary\"}], \"surface\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"surface\"}], \"table\": [{\"cells\": {\"fill\": {\"color\": \"#EBF0F8\"}, \"line\": {\"color\": \"white\"}}, \"header\": {\"fill\": {\"color\": \"#C8D4E3\"}, \"line\": {\"color\": \"white\"}}, \"type\": \"table\"}]}, \"layout\": {\"annotationdefaults\": {\"arrowcolor\": \"#2a3f5f\", \"arrowhead\": 0, \"arrowwidth\": 1}, \"colorscale\": {\"diverging\": [[0, \"#8e0152\"], [0.1, \"#c51b7d\"], [0.2, \"#de77ae\"], [0.3, \"#f1b6da\"], [0.4, \"#fde0ef\"], [0.5, \"#f7f7f7\"], [0.6, \"#e6f5d0\"], [0.7, \"#b8e186\"], [0.8, \"#7fbc41\"], [0.9, \"#4d9221\"], [1, \"#276419\"]], \"sequential\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"sequentialminus\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]]}, \"colorway\": [\"#636efa\", \"#EF553B\", \"#00cc96\", \"#ab63fa\", \"#FFA15A\", \"#19d3f3\", \"#FF6692\", \"#B6E880\", \"#FF97FF\", \"#FECB52\"], \"font\": {\"color\": \"#2a3f5f\"}, \"geo\": {\"bgcolor\": \"white\", \"lakecolor\": \"white\", \"landcolor\": \"#E5ECF6\", \"showlakes\": true, \"showland\": true, \"subunitcolor\": \"white\"}, \"hoverlabel\": {\"align\": \"left\"}, \"hovermode\": \"closest\", \"mapbox\": {\"style\": \"light\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"#E5ECF6\", \"polar\": {\"angularaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\"}, \"bgcolor\": \"#E5ECF6\", \"radialaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\"}}, \"scene\": {\"xaxis\": {\"backgroundcolor\": \"#E5ECF6\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"white\"}, \"yaxis\": {\"backgroundcolor\": \"#E5ECF6\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"white\"}, \"zaxis\": {\"backgroundcolor\": \"#E5ECF6\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"white\"}}, \"shapedefaults\": {\"line\": {\"color\": \"#2a3f5f\"}}, \"ternary\": {\"aaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\"}, \"baxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\"}, \"bgcolor\": \"#E5ECF6\", \"caxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\"}}, \"title\": {\"x\": 0.05}, \"xaxis\": {\"automargin\": true, \"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\", \"zerolinecolor\": \"white\", \"zerolinewidth\": 2}, \"yaxis\": {\"automargin\": true, \"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\", \"zerolinecolor\": \"white\", \"zerolinewidth\": 2}}}, \"title\": {\"font\": {\"color\": \"#4D5663\"}}, \"xaxis\": {\"gridcolor\": \"#E1E5ED\", \"showgrid\": true, \"tickfont\": {\"color\": \"#4D5663\"}, \"title\": {\"font\": {\"color\": \"#4D5663\"}, \"text\": \"\"}, \"zerolinecolor\": \"#E1E5ED\"}, \"yaxis\": {\"gridcolor\": \"#E1E5ED\", \"showgrid\": true, \"tickfont\": {\"color\": \"#4D5663\"}, \"title\": {\"font\": {\"color\": \"#4D5663\"}, \"text\": \"\"}, \"zerolinecolor\": \"#E1E5ED\"}},\n",
       "                        {\"showLink\": true, \"linkText\": \"Export to plot.ly\", \"plotlyServerURL\": \"https://plot.ly\", \"responsive\": true}\n",
       "                    ).then(function(){\n",
       "                            \n",
       "var gd = document.getElementById('673569eb-d1fb-4dde-8be7-e8b7df72b128');\n",
       "var x = new MutationObserver(function (mutations, observer) {{\n",
       "        var display = window.getComputedStyle(gd).display;\n",
       "        if (!display || display === 'none') {{\n",
       "            console.log([gd, 'removed!']);\n",
       "            Plotly.purge(gd);\n",
       "            observer.disconnect();\n",
       "        }}\n",
       "}});\n",
       "\n",
       "// Listen for the removal of the full notebook cells\n",
       "var notebookContainer = gd.closest('#notebook-container');\n",
       "if (notebookContainer) {{\n",
       "    x.observe(notebookContainer, {childList: true});\n",
       "}}\n",
       "\n",
       "// Listen for the clearing of the current output cell\n",
       "var outputEl = gd.closest('.output');\n",
       "if (outputEl) {{\n",
       "    x.observe(outputEl, {childList: true});\n",
       "}}\n",
       "\n",
       "                        })\n",
       "                };\n",
       "                });\n",
       "            </script>\n",
       "        </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "source_df.iplot(kind='scatter',x='Year')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:root] *",
   "language": "python",
   "name": "conda-root-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
